import {createRouter, createWebHashHistory, RouteRecordRaw} from "vue-router"

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        redirect: "/index"
    },
    {
        path: "/index",
        name: "index",
        component: () => import("@/pages/index/index.vue"),
        meta: {
            title: "首页"
        }
    },
    {
        path: "/detail",
        name: "detail",
        component: () => import("@/pages/detail/index.vue"),
        meta: {
            title: "详情"
        }
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: routes
})

router.beforeEach(async (to, from, next) => {
    next()
})

export default router
